package com.lmf.plus.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
 * 定义实体类：默认的表名与实体类同名(忽略字母大小写)；如果不一致，在实体类定义上面使用 @TableName(value="表名") 指明对应表的名称
 */
@TableName(value = "user_address")  //这个表名必须与数据库中的表名一致,不能乱搞
public class Address {

    @TableId(value = "id",type = IdType.AUTO)
    /**
     * 如果创建实体类的变量名，与数据库中表的列名不一致，则需要使用 @TableField("字段名，也叫列名") 来指一个个指定每个变量的映射列名
     */
    @TableField("user_id")
    private Integer id;
    @TableField("user_city")
    private String city;
    @TableField("user_street")
    private String street;
    @TableField("user_number")
    private Integer number;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    @Override
    public String toString() {
        return "Address{" +
                "id=" + id +
                ", city='" + city + '\'' +
                ", street='" + street + '\'' +
                ", number=" + number +
                '}';
    }
}
